checkIfMultiDimentional = function(arr){
for(var item in arr)
{
if(typeof(arr[item]) == 'object') { return true; }
}
return false;
}
myJsonify = function(thing, level)
{
var jsonString = "";
if(!level) { level = 0; }
var start;
if(typeof(thing) == 'object') {
if(checkIfMultiDimentional(thing))
{
start = 0;
for(var item in thing)
{
var value = thing[item];
if(start > 0) { jsonString += ','; }

if(value.substring) { jsonString += item+":"+value; }
else { jsonString += "\""+item+"\":{"+myJsonify(value, level+1)+"}"; }
start++;
}
}
else
{
start = 0;
for(var item in thing)
{
if(start > 0){ jsonString +=','; }
jsonString += "\""+item+"\":"+thing[item];
start++;
}

return jsonString;
}
}
else { jsonString = thing; }
return jsonString;
}